<?php

CCore::Using('mime.part');
CCore::Using('mime.callbacks.interface');

class CCoreMimeCallbacksMemory implements ICoreMimeCallbacks
{
	/**
	 * @var CCoreMimePart
	 */
	private $_oCurrentMime = null;

	/**
	 * @param CCoreMimePart $oMimePart
	 * @return void
	 */
	public function StartParse(CCoreMimePart &$oMimePart) {}

	/**
	 * @param CCoreMimePart $oMimePart
	 * @return void
	 */
	public function EndParse(CCoreMimePart &$oMimePart) {}

	/**
	 * @param CCoreMimePart $oMimePart
	 * @return void
	 */
	public function StartParseMimePart(CCoreMimePart &$oMimePart)
	{
		$this->_oCurrentMime = $oMimePart;
	}

	/**
	 * @param CCoreMimePart $oMimePart
	 * @return void
	 */
	public function EndParseMimePart(CCoreMimePart &$oMimePart) {}

	/**
	 * @param CCoreMimePart $oMimePart
	 * @return void
	 */
	public function InitMimePartHeader() {}

	/**
	 * @param CCoreMimePart $oMimePart
	 * @param string $sBuffer
	 * @return void
	 */
	public function ReadBuffer($sBuffer) {}

	/**
	 * @param CCoreMimePart $oMimePart
	 * @param string $sBuffer
	 * @return void
	 */
	public function WriteBody($sBuffer)
	{
		fwrite($this->_oCurrentMime->Body, $sBuffer);
	}
}
